package cn.fenglaicaimi.base.domain;

import com.alibaba.druid.support.json.JSONUtils;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

@Getter@Setter
public class Good {
    //上架状态
    public static final int PUTAWAY_STATE = 0;
    //下架状态
    public static final int SOLDOUT_STATE = 1;
    //食品类型
    public static final int FOOD_SORT = 1;
    //日用品类型
    public static final int COMMODITY_SORT = 2;

    private Long id;
    //商品名称
    private String name;
    //商品图片
    private String image;
    //商品价格
    private Long price;
    //商品状态
    private Integer state;
    //商品分类
    private Integer sort;

    public String getJson(){
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("id",id);
        map.put("name",name);
        map.put("image",image);
        map.put("price",price);
        map.put("state",state);
        map.put("sort",sort);
        return JSONUtils.toJSONString(map);
    }

}